package guoanmaker.provider.business.repository;

import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;


import guoanmaker.provider.business.model.ProvideUser;

/**
*
* 
* @author vladimir.stankovic
*
* Aug 16, 2016
*/
public interface ProvideUserRepository extends JpaRepository<ProvideUser, String>, JpaSpecificationExecutor<ProvideUser>{
	@Query("select u from ProvideUser u left join fetch u.roles r where u.username=:username")
    public Optional<ProvideUser> findByUsername(@Param("username") String username);

}
